package controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value="/users")
public class CommonController {
	
	@GetMapping
	public String work1() {
		System.out.println("work 1.........");
		return "work1....";
	}
	@RequestMapping(method= {RequestMethod.POST,RequestMethod.PUT})
	public String work2() {
		System.out.println("work 2.........");
		return "work 2.....";
	}
	
	@PutMapping(value="abcid")
	public String work3() {
		System.out.println("work 2.........");
		return "work 3.....";
	}
	
	@GetMapping(value="ab",consumes="application/json")
	public String work4() {
		
		return "work 4.....";
	}
	
	@GetMapping(value="ab",consumes= {"application/xml"})
	public String work5() {
		
		return "work 5.....";
	}
	
	@GetMapping(value="ac",params= {"id=1"})
	public String work6() {
		
		return "work 6.....";
	}
	
	@GetMapping(value="ac",params= {"id=2"})
	public String work7() {
		
		return "work 7.....";
	}
	
}
